home *** CD-ROM | disk | FTP | other *** search
/ Nautilus 1992 July / Nautilus-3-8 / Nautilus-3-8.bin / Tools & Utilities / Techy Stuff / Doco ƒ / CSMP ƒ / CSMP-V1-007.TXT < prev    next >
Encoding:
Text File  |  1992-06-03  |  52.0 KB  |  1,571 lines

  1. C.S.M.P. Digest             Sun, 08 Mar 92       Volume 1 : Issue 7
  2.  
  3. Today's Topics:
  4.  
  5.     ? XVT Questions
  6.     o please help me find Think Pascal TCL examples
  7.     Compressed resources in ResEdit 2.1.1?
  8.     Public Domain C/C++ compilers?
  9.     Need Programmer Switch on IIsi
  10.     Mac Program, which program flow ?
  11.     Init Benchmark Shareware Location
  12.     C code for restarting the Finder
  13.     Posting a notification with buttons?
  14.     MoveControl within dialog box.
  15.     Unloading Member Function Revisited (long)
  16.     Does the SCSI Manager support devices that disconnect?
  17.     Microsoft word format question
  18.     Sun .au format -> Mac sound format software?
  19.     Alternate LAP support under MacTCP 1.1
  20.     Hiding Folders in Think C - again
  21.     Think C 5.0 bug ?
  22.     system calls
  23.     ThinkC TCL Printer problem - too many strips
  24.  
  25.  
  26. The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
  27.  
  28. These digests are available (by using FTP, account anonymous, your email
  29. address as password) in the pub/mac directory on ftp.cs.uoregon.edu.
  30. This is also the home of the comp.sys.mac.programmer Frequently Asked
  31. Questions list.
  32.  
  33. The articles in these digests are taken directly from comp.sys.mac.programmer.
  34. They are not edited; all articles included in this digest are in their original
  35. posted form.  The only articles that are -not- included in these digests are
  36. those which didn't receive any replies (except those that give information
  37. rather than ask a question).  All replies to each article are concatenated
  38. onto the original article in the order in which they were received.  Article
  39. threads are not added to the digests until the last article added to the
  40. thread is at least one month old (this is to ensure that the thread is dead
  41. before adding it to the digests).
  42.  
  43. Send administrative mail to mkelly@cs.uoregon.edu.
  44.  
  45. -------------------------------------------------------
  46.  
  47. From: CHARLESW@QUCDN.QueensU.CA
  48. Subject: ? XVT Questions
  49. Date: 30 Jan 92 03:59:11 GMT
  50. Organization: Queen's University at Kingston
  51.  
  52.  
  53.   Could someone please send me contact info for the company that produces
  54. XVT?
  55.  
  56.   While I'm here, a couple of questions for those who've used it:
  57.  
  58. 1)  How does XVT handle dialogs on character-based systems?
  59. 2)  Does XVT handle MOTIF and char-based systems for VMS-based VAXes?  (I'm
  60.     thinking of XVT for a project with Oracle that has users accessing data
  61.     from VTxxx terminals, VAXstations, Macs, MS-DOS and Windows PCs.  The
  62.     main alternative seems to be SQL*Forms.)
  63. 3)  How do you handle documentation for the different platforms?  Is it
  64.     reasonable to do a single document in something like FrameMaker with
  65.     examples and diagrams selected for printing based on the platform you're
  66.     describing?
  67.  
  68. Thanks for any advice you can offer (those are pretty broad questions).
  69.  
  70. .../dave
  71.  
  72. Dave Charlesworth
  73.  
  74.  
  75.  
  76. - -------------------------
  77.  
  78. From: stephenm@syacus.acus.oz.au (Stephen McIntosh)
  79. Subject:  ? XVT Questions
  80. Date: 1 Feb 92 12:32:14 GMT
  81. Organization: ACUS Australian Centre for Unisys Software, Sydney
  82.  
  83. CHARLESW@QUCDN.QueensU.CA writes:
  84. > Could someone please send me contact info for the company that produces XVT?
  85. > How does XVT handle dialogs on character-based systems?
  86.  
  87. Beware of trying to emulate a GUI environment in a text scenario.
  88. Other more important points are colour support, native OS help, 
  89. MDI (Windows 3.0, Excel and Word, etc) and other specific features that may
  90. not be supported directly through the tool(s) that you may choose. 
  91.  
  92. Suggest prototyping your final system then evaluate a tool(s) VERY VERY wisely 
  93. before development begins.
  94.  
  95. Regards
  96. Stephen McIntosh
  97. -- 
  98. Sincerely
  99. Stephen McIntosh
  100. ACUS-The Australian Centre for UNISYS software
  101. Phone:    +61-2-390-1371    | ACSnet:   stephenm@syacus.OZ
  102.  
  103.  
  104.  
  105. ---------------------------
  106.  
  107. From: jasper@geriatrix.cs.uoregon.edu (Jon Barber)
  108. Subject: o please help me find Think Pascal TCL examples
  109. Organization: University of Oregon Computer and Information Sciences Dept.
  110. Date: Fri, 31 Jan 1992 20:29:36 GMT
  111.  
  112. Can anyone O Please help me find Think Pascal 4.0 with TCL
  113. programs with source code listings?  
  114.  
  115. Is there a FTP site?  A digest?  Does anyone have a good
  116. library of code they use for development?
  117.  
  118. I'm developing software to teach biology concepts for the
  119. biology dept here, and while I'm an experienced programmer,
  120. I'm basically in my second month of Macintosh programming.
  121. Examples are the way to go, to learn stuff, but just
  122. rooting around in the Art Class project doesn't answer
  123. very many questions.
  124.  
  125. Actually, the code could really be in any language - I'm
  126. just hoping to gain greater insight into Mac programming
  127. techniques.
  128.  
  129. By helping me you will be making the world a much better
  130. place (for introductory biology students, anyway).
  131.  
  132. Thanks in advance
  133.  
  134. <jasper>
  135.  
  136.  
  137.  
  138. - -------------------------
  139.  
  140. From: 881571s@aucs.acadiau.ca (Arnold Spence)
  141. Subject:  o please help me find Think Pascal TCL examples
  142. Date: 4 Feb 92 17:34:48 GMT
  143. Organization: Acadia University
  144.  
  145. I posted a similar request 2 months ago and the only response I got was email
  146. from a couple of people looking for the same thing. I believe that if anyone
  147. can assist, there will be many that will appreciate it. 
  148.  
  149. if end_of_message then
  150.   writeln('Arnold B. Spence : 881571s@aucs.acadiau.ca');
  151.  
  152.  
  153.  
  154. ---------------------------
  155.  
  156. From: dwood@zia.aoc.nrao.edu (Doug Wood)
  157. Subject: Compressed resources in ResEdit 2.1.1?
  158. Organization: National Radio Astronomy Observatory, Socorro NM
  159. Date: Fri, 31 Jan 92 17:00:05 GMT
  160.  
  161. The Get Info window for a resource in ResEdit (2.1.1) has
  162. a check box that says "Compressed".  This option does not
  163. appear in Apple's "ResEdit Reference" manual (p.20).
  164. When I click the option, however, it refuses to be checked.
  165.  
  166. Can someone explain this feature?  Does it work?  Can I use
  167. it to compress PICT data in resources to reduce the disk
  168. space used by my application?
  169.  
  170. Thanks!
  171.  
  172. Doug Wood
  173. dwood@nrao.edu
  174.  
  175.  
  176.  
  177. - -------------------------
  178.  
  179. From: alana@sisters.cs.uoregon.edu (Thomas Alan Akins)
  180. Subject:  Compressed resources in ResEdit 2.1.1?
  181. Organization: /local/lib/rn/organization
  182. Date: Sat, 1 Feb 1992 07:42:59 GMT
  183.  
  184. Regarding compressed resources in ResEdit:
  185.  
  186.     I believe, like the "Resource Map is Read Only" and "File Protect" 
  187. and "File Busy" check boxes that can be found under the "Get Info..." File
  188. Menu, that the "Compressed" check box cannot be changed from ResEdit. It is
  189. merely informational (from ResEdit, at least).
  190.  
  191. -- 
  192. *                                            Alan Akins                      *
  193. *       "I could say 'addition'              alana@cs.uoregon.edu            *
  194. *        when I mean ... 'basketball.'"      University of Oregon            *
  195. *                        - E. Tick           Department of Computer Science  *
  196.  
  197.  
  198.  
  199. - -------------------------
  200.  
  201. From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
  202. Subject:  Compressed resources in ResEdit 2.1.1?
  203. Date: 31 Jan 92 20:59:32 GMT
  204. Organization: Kalamazoo College
  205.  
  206. dwood@zia.aoc.nrao.edu (Doug Wood) writes:
  207. >The Get Info window for a resource in ResEdit (2.1.1) has
  208. >a check box that says "Compressed".  This option does not
  209. >appear in Apple's "ResEdit Reference" manual (p.20).
  210. >When I click the option, however, it refuses to be checked.
  211. >
  212. >Can someone explain this feature?  Does it work?  Can I use
  213. >it to compress PICT data in resources to reduce the disk
  214. >space used by my application?
  215.  
  216. Alas, no.  To reduce System 7's footprint, Apple developed their own
  217. compression and expansion code, and bundled it with the Resource
  218. Manager.  Compressed resources are automatically decompressed when
  219. they're opened.  (Try opening one in ResEdit, it'll warn you.)
  220.  
  221. But Apple isn't releasing the compression code until it's firmed up and
  222. solid and ready to be used;  unfortunately, it's been almost a year and
  223. there's no sign of it.  So you can look but you can't touch.
  224. -- 
  225.  Jamie McCarthy     Internet: k044477@kzoo.edu     AppleLink: j.mccarthy
  226.  Kzoo randomly kills all my mail;  if I don't acknowledge, try resending.    
  227.  
  228.  
  229.  
  230. ---------------------------
  231.  
  232. From: sheldon@kong.gsfc.nasa.gov (Roger Sheldon - AISS)
  233. Subject: Public Domain C/C++ compilers?
  234. Date: 31 Jan 92 16:51:09 GMT
  235. Organization: Goddard Space Flight Center
  236.  
  237. This is probably an FAQ.  What public domain C++ (or just C) compilers
  238. are available for a mac without AU/X?
  239.  
  240. Thanks,
  241.  
  242. Roger Sheldon      sheldon@kong.gsfc.nasa.gov
  243.  
  244.  
  245.  
  246. - -------------------------
  247.  
  248. From: e-sink@uiuc.edu (Eric W. Sink)
  249. Subject:  Public Domain C/C++ compilers?
  250. Date: 31 Jan 92 18:58:35 GMT
  251. Organization: University of Illinois at Urbana-Champaign
  252.  
  253. In <1992Jan31.165109.14807@kong.gsfc.nasa.gov> sheldon@kong.gsfc.nasa.gov (Roger Sheldon - AISS) writes:
  254.  
  255. >This is probably an FAQ.  What public domain C++ (or just C) compilers
  256. >are available for a mac without AU/X?
  257.  
  258. There are no public domain C or C++ compilers for the Mac (that I am aware
  259. of).  In the closely related category of freely distributable, there are
  260. no C++ offerings either, but there are a few C compilers:
  261.  
  262. 1.  GNU C.  This product is under the terms of the GNU Public License,
  263.     and runs only under MPW.  Requires the MPW includes and libraries,
  264.     as well as the MPW Assembler.  Awesome compiler.
  265.  
  266. 2.  Sesame C.  A shareware compiler which handles a subset of C.  Has
  267.     been out for some time, and I have never seen an update.
  268.  
  269. 3.  Harvest C.  I'm the author of this one.  It is shareware right now.
  270.     Compiles all of ANSI C, most MPW extensions.  Requires the MPW
  271.     includes and libraries.  Slow, poor user interface.  New version
  272.     is in the works, and it will no longer be shareware.
  273.  
  274. -- 
  275. Eric W. Sink,  Spatial Analysis and Systems Team
  276. USACERL, P.O. Box 9005, Champaign, IL 61826-9005
  277. 1-800-USA-CERL x449,   e-sink@uiuc.edu
  278.  
  279.  
  280.  
  281. ---------------------------
  282.  
  283. From: chrism@col.hp.com (Chris Magnuson)
  284. Date: Sat, 1 Feb 1992 00:25:45 GMT
  285. Subject: Need Programmer Switch on IIsi
  286. Organization: HP Colorado Springs Division
  287.  
  288. Anyone figured out how to get the equivalent of a programmer's switch (like
  289. the SE has) on a Mac IIsi.  I really miss that little switch.
  290.  
  291. Thanks,
  292. chrism@col.hp.com
  293.  
  294.  
  295.  
  296. - -------------------------
  297.  
  298. From: greeny@top.cis.syr.edu (Jonathan Greenfield)
  299. Subject:  Need Programmer Switch on IIsi
  300. Date: 1 Feb 92 04:56:00 GMT
  301. Organization: CIS Dept., Syracuse University
  302.  
  303. In article <65790007@col.hp.com> chrism@col.hp.com (Chris Magnuson) writes:
  304. >Anyone figured out how to get the equivalent of a programmer's switch (like
  305. >the SE has) on a Mac IIsi.  I really miss that little switch.
  306.  
  307. For an LC it's Control-Command-Reset.
  308.  
  309. Interrupt (for use with debuggers) is Command-Reset.
  310.  
  311. (This is from "Special Features of Your Macintosh LC."  Try checking the
  312. equivalent for your IIsi if these don't work.)
  313.  
  314. --
  315. greeny                                           greeny@top.cis.syr.edu
  316.  
  317. "What's the difference between an orange?"
  318.  
  319.  
  320.  
  321. - -------------------------
  322.  
  323. From: chrism@col.hp.com (Chris Magnuson)
  324. Subject:  Need Programmer Switch on IIsi
  325. Date: 2 Feb 92 07:38:32 GMT
  326. Organization: HP Colorado Springs Division
  327.  
  328. HHmm.  Guess I shoulda read them manuals...
  329.  
  330.  
  331.  
  332. ---------------------------
  333.  
  334. From: pope@daimi.aau.dk (Povl Hessellund Pedersen)
  335. Subject: Mac Program, which program flow ?
  336. Date: 1 Feb 92 12:33:07 GMT
  337. Organization: DAIMI: Computer Science Department, Aarhus University, Denmark
  338.  
  339. I am going to write a mac application, which
  340. among other thing will support at least 3 different
  341. windows somehow representing the same data in a few
  342. ways, but they will be quite different.
  343.  
  344. My question is, how should I build up the program ?
  345. I could use one event-loop, or I could write an independent
  346. event loop for each window type.  In both cases I see
  347. some minor problems when switching from one window
  348. to another very different one.  Menus will also have
  349. to be handled different depending on the fron window.
  350.  
  351. Any good ideas / advice ?
  352. --
  353. Povl H. Pedersen (External student at dept. of CS, student at dept. economics)
  354. Macintosh programmer, consultant and technical support
  355. eco861771@ecostat.aau.dk   /   pope@daimi.aau.dk
  356.  
  357.  
  358.  
  359. - -------------------------
  360.  
  361. From: re00+@andrew.cmu.edu (Robert H Earhart)
  362. Subject:  Mac Program, which program flow ?
  363. Date: 1 Feb 92 17:35:18 GMT
  364. Organization: Freshman, MCS general, Carnegie Mellon, Pittsburgh, PA
  365.  
  366.  
  367.   I've always handled that by using one event loop, testing update
  368. events to see which window I should be drawing in and jumping to the
  369. appropriate draw routine, and upon an activate event sending myself an
  370. application defined event (although under system Seven Apple events
  371. work nicely...) that activates the a function from the event loop to
  372. calculate which menus should be hilighted, highlites them, and purges
  373. all other updateMenu events...
  374.  
  375.   -Rob
  376.  
  377.  
  378.  
  379. - -------------------------
  380.  
  381. From: ABSURD@applelink.apple.com (Tim Dierks, ToyMeister, Cray abuser)
  382. Subject:  Mac Program, which program flow ?
  383. Date: 4 Feb 92 20:55:52 GMT
  384. Organization: MacDTS, Apple Computer
  385.  
  386. In article <1992Feb1.123307.14614@daimi.aau.dk>, pope@daimi.aau.dk (Povl Hessellund Pedersen) writes:
  387. > I am going to write a mac application, which
  388. > among other thing will support at least 3 different
  389. > windows somehow representing the same data in a few
  390. > ways, but they will be quite different.
  391. > My question is, how should I build up the program ?
  392. > I could use one event-loop, or I could write an independent
  393. > event loop for each window type.  In both cases I see
  394. > some minor problems when switching from one window
  395. > to another very different one.  Menus will also have
  396. > to be handled different depending on the fron window.
  397. > Any good ideas / advice ?
  398.  
  399. I strongly recommend that people keep the number of event loops they have to 
  400. the smallest number possible.  When you've got to deal with stuff like AppleEvents
  401. and other things, you need to be as non-modal as possible, and that includes
  402. your internal code structure.  If you need to implement shockingly different
  403. behavior for a number of windows, it's best to decide precisely what kind of
  404. things will change, and implement them as functions which you access through
  405. function pointers stored in a record pointed to by the windows refCon.  This
  406. way, if something happens (such as an update event), all you have to do is
  407. take the appropriate window pointer, look in the refCon, fetch the appropriate
  408. function pointer, and call it.  This is a lot easier to maintain and change
  409. than a system based on big case statements for different kinds of windows,
  410. or having seperate event loops for seperate modes of your program.
  411.  
  412. Tim Dierks
  413. MacDTS, but I speak for myself
  414.  
  415.  
  416.  
  417. ---------------------------
  418.  
  419. From: braun-eric@CS.YALE.EDU (Eric E. Braun)
  420. Subject: Init Benchmark Shareware Location
  421. Date: 1 Feb 92 21:15:56 GMT
  422. Organization: Yale University Computer Science Dept., New Haven, CT 06520-2158
  423.  
  424. Howdy,
  425. Could somebody please point me to an ftp site where I can pick up an
  426. init benchmarker (like Speedometer 2.0)?
  427.  
  428. Thanks, Eric
  429.  
  430.  
  431.  
  432. - -------------------------
  433.  
  434. From: jquejada@isis.cs.du.edu (Joel Quejada)
  435. Subject:  Init Benchmark Shareware Location
  436. Date: 2 Feb 92 02:03:26 GMT
  437. Organization: Nyx, Public Access Unix at U. of Denver Math/CS dept.
  438.  
  439. In article <1992Feb1.211556.11871@cs.yale.edu> braun-eric@CS.YALE.EDU (Er
  440. c E. Braun) writes:
  441. >Howdy,
  442. >Could somebody please point me to an ftp site where I can pick up an
  443. >init benchmarker (like Speedometer 2.0)?
  444. >
  445. >Thanks, Eric
  446.  
  447.  
  448. I'm not sure if they have Speedometer 2.0 but they sure have a large
  449. selection of Mac shareware/PD stuff.  The addresses is
  450. sumex-aim.stanford.edu. Once you're on, cd over to the info-mac
  451. directory.
  452.  
  453. Hope this helps!
  454.  
  455. -Joel Quejada
  456. jaq@bilbo.baylor.edu
  457.  
  458.  
  459.  
  460. ---------------------------
  461.  
  462. From: engber@ils.nwu.edu (Mike Engber)
  463. Subject: C code for restarting the Finder
  464. Date: 2 Feb 92 03:05:27 GMT
  465. Organization: The Institute for the Learning Sciences
  466.  
  467.  
  468. I've been playing around with killing and restarting the Finder (and trying
  469. to wreak as little havoc as possible in the process)
  470.  
  471. I've made a few discoveries, and raised a few. 
  472.  
  473. Attached is THINK C code which I'm currently using with good result.
  474. So far, it seems to work pretty well.  If anyone has any suggestions
  475. for improvements, esp ones that will make it safer, please let me
  476. know.
  477.  
  478. Basically what goes on:
  479.  
  480.  - get the process serial# & FSpec of the current Finder
  481.  
  482.  - get the process serial# & FSpec of the File Sharing Extension
  483.  
  484.  - if the File Sharing Extension is around, send it a quit Apple Event.
  485.    Emperically, I discoverd you'd better not wait for a reply to the
  486.    quit AE or you end up hanging. Why? I don't know. Anyone care to comment?
  487.  
  488.  - Send a quit AE to the Finder, here I've found I need to wait for a reply.
  489.  
  490.  - Launch the Finder
  491.  
  492.  - Wait for the Finder to become the front process. It seems if your app
  493.    is the only one running and it quits too soon, you'll get system error 41.
  494.    This is a weird one, I have no explanation. The Finder shows up as a
  495.    running process according the Process Mangager, but I assume it's not
  496.    yet fully loaded/initialized - so you need to wait a bit before quitting.
  497.    Waiting for it to become the front process was the simplest method I
  498.    came up with for deciding when it was safe to quit. If anyone can shed
  499.    more light on this, please do.
  500.  
  501. This last step was a pretty tricky one. Since I normally have DarkSide running
  502. I never discovered the problem myself. Plus, you'd think that having many
  503. apps running is the hard test case to pass. One program that has this bug is
  504. Finder Edit, try running it as the only app - bomb.
  505.  
  506. Anyway here's the code. The only function you need to export is RestartFinder.
  507.  
  508. -ME
  509.  
  510. - -
  511.  
  512. /*
  513.  * Restarting the Finder - written in THNIK C 5.0
  514.  */
  515.  
  516. #include <AppleEvents.h>
  517.  
  518. /* Looks through running processes for one with the specified type and signature.
  519.  * Passes back the its ProcessSerialNumber & FSSpec.
  520.  */
  521. static OSErr FindProcess(OSType processType, OSType processSig, ProcessSerialNumberPtr psn_p, FSSpecPtr spec_p){
  522.     ProcessInfoRec  pinfo;
  523.     pinfo.processName       = NULL;
  524.     pinfo.processInfoLength = sizeof(pinfo);
  525.     pinfo.processAppSpec    = spec_p;
  526.     
  527.     psn_p->highLongOfPSN = 0;
  528.     psn_p->lowLongOfPSN  = kNoProcess;
  529.     
  530.     while(!GetNextProcess(psn_p)){
  531.         if(!GetProcessInformation(psn_p,&pinfo) &&
  532.             pinfo.processType       == processType  &&
  533.             pinfo.processSignature  == processSig){
  534.                 return noErr;
  535.         }
  536.     }
  537.     return -1;
  538. }
  539.  
  540. /* Sends the specified process a quit AE.
  541.  */
  542. static OSErr QuitProcess(ProcessSerialNumberPtr psn_p, Boolean wait){
  543.     OSErr               err;
  544.     AppleEvent          ae;
  545.     AppleEvent          aeReply;
  546.     AEAddressDesc       aeAddr;
  547.     
  548.     if(err=AECreateDesc(typeProcessSerialNumber,(Ptr)psn_p,sizeof(ProcessSerialNumber),&aeAddr)) return err;
  549.     if(err=AECreateAppleEvent(kCoreEventClass,kAEQuitApplication,&aeAddr,0,kAnyTransactionID,&ae)){
  550.         AEDisposeDesc(&aeAddr);
  551.         return err;
  552.     }
  553.     err = AESend(&ae,&aeReply,wait?kAEWaitReply:kAENoReply,kAENormalPriority,kNoTimeOut,NULL,NULL);
  554.     AEDisposeDesc(&ae);
  555.     AEDisposeDesc(&aeAddr);
  556.     AEDisposeDesc(&aeReply);
  557.     return err;
  558. }
  559.  
  560.  
  561. /* Passes back the Finder's ProcessSerialNumber & FSSpec. */
  562. static OSErr FindFinder(ProcessSerialNumberPtr psn_p, FSSpecPtr spec_p){
  563.     return FindProcess('FNDR','MACS',psn_p,spec_p);
  564. }
  565.  
  566. /* Passes back the File Sharing Extension's ProcessSerialNumber. */
  567. static OSErr FindFileShareExt(ProcessSerialNumberPtr psn_p){
  568.     FSSpec  danQuayle;
  569.     return FindProcess('INIT','hhgg',psn_p,&danQuayle);
  570. }
  571.  
  572.  
  573.  
  574. /* Sends the Finder a quit AE.
  575.  * Passes back the Finder's FSSpec for re-Launching it.
  576.  */
  577. static OSErr QuitFinder(FSSpecPtr finderSpec_p){
  578.     OSErr               err;
  579.     ProcessSerialNumber finderPsn;
  580.     ProcessSerialNumber fSharePsn;
  581.  
  582.     if(err=FindFinder(&finderPsn,finderSpec_p)) return err;
  583.  
  584.     /* find & quit the File Sharing Extension */
  585.     if(!FindFileShareExt(&fSharePsn)){
  586.         if(err=QuitProcess(&fSharePsn,false)) return err;
  587.     }
  588.  
  589.     /* now quit the Finder */
  590.     return QuitProcess(&finderPsn,true);
  591. }
  592.  
  593.  
  594. /* Launches the Finder */
  595. static OSErr LaunchFinder(FSSpecPtr finderSpec_p){
  596.     LaunchParamBlockRec pb;
  597.     pb.launchBlockID        = extendedBlock;
  598.     pb.launchEPBLength      = extendedBlockLen;
  599.     pb.launchControlFlags   = launchContinue + launchNoFileFlags;
  600.     pb.launchAppSpec        = finderSpec_p;
  601.     pb.launchAppParameters  = NULL;
  602.     
  603.     return LaunchApplication(&pb);
  604. }
  605.  
  606.  
  607. OSErr RestartFinder(void){
  608.     OSErr   err;
  609.     FSSpec  finderSpec;
  610.  
  611.     if(err=QuitFinder(&finderSpec))     return err;
  612.     if(err=LaunchFinder(&finderSpec))   return err;
  613.  
  614.     /* Wait until we're not the FrontProcess, else we may ExitToShell before the Finder
  615.      * has fully restarted - which causes system error 41 if we are the only app running.
  616.      * Why this is, I don't know, but this seems to solve the problem.
  617.      *
  618.      * Note: we launch the finder without the launchDontSwitch flag set, so it will become
  619.      *       the front process eventually (else we'd sit around looping till the user decided
  620.      *       to click somewhere and activate the Finder)
  621.      */
  622.     {
  623.         FSSpec              spec;
  624.         Boolean             meFront = true;
  625.         EventRecord         curEvent;
  626.         ProcessSerialNumber psn;
  627.         ProcessSerialNumber myPsn;
  628.     
  629.         if(err=GetCurrentProcess(&myPsn)) return err;
  630.  
  631.         while(meFront){
  632.             WaitNextEvent(everyEvent,&curEvent,15L,0L);
  633.             if(err=GetFrontProcess(&psn)) return err;
  634.             if(err=SameProcess(&psn,&myPsn,&meFront)) return err;
  635.         }
  636.     }
  637.     return noErr;
  638. }
  639.  
  640.  
  641.  
  642. - -------------------------
  643.  
  644. From: grobbins@Apple.COM (Grobbins)
  645. Subject:  C code for restarting the Finder
  646. Date: 2 Feb 92 09:53:11 GMT
  647. Organization: Apple DTS
  648.  
  649. In article <1992Feb2.030527.5817@ils.nwu.edu> engber@ils.nwu.edu (Mike Engber) writes:
  650. > - Send a quit AE to the Finder, here I've found I need to wait for a reply.
  651.  
  652. Remember that launching and sending Apple events actually happen only
  653. at WaitNextEvent time.  You don't really need to wait for a reply
  654. from the Finder; it certainly has little to say in response to a
  655. Quit event.  You _do_ need to call WNE, which is what kAEWaitReply
  656. is doing for you (Inside Mac VI, page 6-60).
  657.  
  658.  
  659. Grobbins             grobbins@apple.com
  660.  
  661.  
  662.  
  663. ---------------------------
  664.  
  665. From: peter@cujo.curtin.edu.au (Peter N Lewis)
  666. Subject: Posting a notification with buttons?
  667. Organization: NCRPDA, Curtin University
  668. Date: Sun, 2 Feb 1992 08:09:26 GMT
  669.  
  670.  
  671. Hi All,
  672.  
  673. Anyone got any ideas how to do this?  I've got a background only application,
  674. that I want to leave running all the time.  When it gets a message from
  675. another machine I want it to put up a notification to tell the user
  676. to run the foreground UI for the program.  I can do that easy enough
  677. using the notification manager with a string ptr.  But what I'd like
  678. to be able to put up a notification with two buttons, "OK", and "Launch"
  679. and if the user clicks launch get my program to automagically launch
  680. the UI program.  I can't see anyway to do this.  I don't think using
  681. a notification proc will work, since I won't be able to put up an
  682. alert from there, or get at my resources (will I?).
  683.  
  684. Another point, how can I make the alert go away after say 5 minutes if 
  685. the user hasn't OKed it?  If I go NMRemove, will that take down the alert?
  686. (Sorry, I don't have IM6, and the technotes still aren't on ftp.apple.com
  687. except in stack format)-:
  688.  
  689. Anyone have any ideas how I could do this?  TIA,
  690.    Peter.
  691. ______________________________________________________________________
  692. Peter N Lewis, NCRPDA, Curtin University      peter@cujo.curtin.edu.au
  693. GPO Box U1987, Perth WA 6001, AUSTRALIA            FAX: +61 9 367 8141
  694.  
  695.  
  696.  
  697.  
  698.  
  699. - -------------------------
  700.  
  701. From: keith@Apple.COM (Keith Rollin)
  702. Subject:  Posting a notification with buttons?
  703. Date: 3 Feb 92 03:23:20 GMT
  704. Organization: Apple Computer Inc., Cupertino, CA
  705.  
  706. In article <1992Feb2.080926.14800@cujo.curtin.edu.au> peter@cujo.curtin.edu.au (Peter N Lewis) writes:
  707. >
  708. >Anyone got any ideas how to do this?  I've got a background only application,
  709. >that I want to leave running all the time.  When it gets a message from
  710. >another machine I want it to put up a notification to tell the user
  711. >to run the foreground UI for the program.  I can do that easy enough
  712. >using the notification manager with a string ptr.  But what I'd like
  713. >to be able to put up a notification with two buttons, "OK", and "Launch"
  714. >and if the user clicks launch get my program to automagically launch
  715. >the UI program.  I can't see anyway to do this.  I don't think using
  716. >a notification proc will work, since I won't be able to put up an
  717. >alert from there, or get at my resources (will I?).
  718. >
  719. >Another point, how can I make the alert go away after say 5 minutes if 
  720. >the user hasn't OKed it?  If I go NMRemove, will that take down the alert?
  721.  
  722. You might be able to do this by installing a driver, and waking it up
  723. with a control call. The next time the driver gets called at dNeedsTime
  724. time, put up your own window. I think this is what AppleShare does when
  725. it displays its "That server just vanished" alert, but that's only a
  726. guess.
  727.  
  728. -- 
  729. - ----------------------------------------------------------------------------
  730. Keith Rollin           ---            <Taligent .signature under construction>
  731. Disclaimer: Pretty soon, I really _won't_ be speaking for Apple...
  732.  
  733.  
  734.  
  735. - -------------------------
  736.  
  737. From: lsr@Apple.COM (Larry Rosenstein)
  738. Subject:  Posting a notification with buttons?
  739. Date: 4 Feb 92 21:53:18 GMT
  740. Organization: Object Based Systems, Apple Computer, Inc.
  741.  
  742. In article <1992Feb2.080926.14800@cujo.curtin.edu.au> peter@cujo.curtin.edu.au (Peter N Lewis) writes:
  743. >
  744. >the UI program.  I can't see anyway to do this.  I don't think using
  745. >a notification proc will work, since I won't be able to put up an
  746. >alert from there, or get at my resources (will I?).
  747.  
  748. You can't be sure of getting at your resources because the notification can
  749. occur within any application.  
  750.  
  751. Other than that problem, I think that a notification proc could bring up a
  752. more complicated dialog, although the human interface guidelines discourages
  753. this.  
  754.  
  755. -- 
  756. Larry Rosenstein, Apple Computer, Inc.
  757.  
  758. lsr@apple.com
  759. (or AppleLink: Rosenstein1)
  760.  
  761.  
  762.  
  763. ---------------------------
  764.  
  765. From: jesjones@milton.u.washington.edu (Jesse Jones)
  766. Subject: MoveControl within dialog box.
  767. Date: 2 Feb 92 19:22:41 GMT
  768. Organization: University of Washington, Seattle
  769.  
  770.  
  771.    Has anyone here tried to move controls inside a dialog around? I'm trying to
  772. implement a convolution kernel editor. The kernels can be different sizes so
  773. I change the dialog windows size and move a few buttons to match the new window
  774. size. However after the buttons are moved they no longer respond to mouse clicks
  775. Any ideas? I also tried leaving the window size alone and moving just one button
  776. with the same results.
  777.  
  778.    In case anyone is wondering I get the control handle for the button using
  779. GetDItem and move the button with MoveControl. This is all done before Modal-
  780. Dialog is called.
  781.  
  782.   --Jesse
  783.  
  784.  
  785.  
  786. - -------------------------
  787.  
  788. From: dougm@descartes.cns.caltech.edu (Doug McNaught)
  789. Subject:  MoveControl within dialog box.
  790. Date: 2 Feb 92 23:15:02 GMT
  791. Organization: California Institute of Technology
  792.  
  793. In article <1992Feb2.192241.2443@milton.u.washington.edu> jesjones@milton.u.washington.edu (Jesse Jones) writes:
  794. >
  795. >   In case anyone is wondering I get the control handle for the button using
  796. >GetDItem and move the button with MoveControl. This is all done before Modal-
  797. >Dialog is called.
  798.  
  799.   Why don't you try GetDItem/change item rect/SetDItem instead. I think the
  800. Dialog Manager does its own hit-testing instead of calling FindControl, so 
  801. it's still using the old rects.
  802. -doug
  803.  
  804.  
  805. -- 
  806. <><><><><><><><><><><><><><><>Go Skins!!<><><><><><><><><><><><><><><><>
  807. <> Doug McNaught                          dougm@descartes.caltech.edu <>
  808. <>         Legalize it / Don't criticize it --- Peter Tosh            <>
  809. <><><><><><><><><><><><><><><>Go Skins!!<><><><><><><><><><><><><><><><>
  810.  
  811.  
  812.  
  813. - -------------------------
  814.  
  815. From: gurhs@uniwa.uwa.oz.au (Rhys Hollow)
  816. Subject:  MoveControl within dialog box.
  817. Date: 3 Feb 92 02:58:27 GMT
  818. Organization: University of Western Australia
  819.  
  820. dougm@descartes.cns.caltech.edu (Doug McNaught) writes:
  821.  
  822. >In article <1992Feb2.192241.2443@milton.u.washington.edu> jesjones@milton.u.washington.edu (Jesse Jones) writes:
  823. >>
  824. >>   In case anyone is wondering I get the control handle for the button using
  825. >>GetDItem and move the button with MoveControl.
  826.  
  827. >  Why don't you try GetDItem/change item rect/SetDItem instead.
  828.  
  829.  
  830. - -------------------------
  831.  
  832.  
  833.   Rhys.  (in a raving mood)
  834. - -----------------------------------------------------------------------------
  835. Rhys Hollow (gurhs@uniwa.uwa.oz.au) "ee'er by gum he's a bad'un!" -DangerMouse.
  836.  
  837.  
  838.  
  839. - -------------------------
  840.  
  841. From: keith@Apple.COM (Keith Rollin)
  842. Subject:  MoveControl within dialog box.
  843. Date: 3 Feb 92 03:24:54 GMT
  844. Organization: Apple Computer Inc., Cupertino, CA
  845.  
  846. In article <1992Feb2.231502.11377@cco.caltech.edu> dougm@descartes.cns.caltech.edu (Doug McNaught) writes:
  847. >In article <1992Feb2.192241.2443@milton.u.washington.edu> jesjones@milton.u.washington.edu (Jesse Jones) writes:
  848. >>
  849. >>   In case anyone is wondering I get the control handle for the button using
  850. >>GetDItem and move the button with MoveControl. This is all done before Modal-
  851. >>Dialog is called.
  852. >
  853. >  Why don't you try GetDItem/change item rect/SetDItem instead. I think the
  854. >Dialog Manager does its own hit-testing instead of calling FindControl, so 
  855. >it's still using the old rects.
  856.  
  857. Changing the rectangle of the dialog item should not be used "instead". When
  858. moving a dialog item that is also a control, both SetDItem and MoveControl
  859. need to be used.
  860.  
  861. -- 
  862. - ----------------------------------------------------------------------------
  863. Keith Rollin           ---            <Taligent .signature under construction>
  864. Disclaimer: Pretty soon, I really _won't_ be speaking for Apple...
  865.  
  866.  
  867.  
  868. - -------------------------
  869.  
  870. From: felciano@medisg.stanford.edu (Ramon Felciano)
  871. Subject:  MoveControl within dialog box.
  872. Date: 3 Feb 92 21:15:16 GMT
  873. Organization: SUMMIT, Stanford U. Medical Media & Information Technologies
  874.  
  875. In article <1992Feb3.025827.4246@uniwa.uwa.oz.au>, gurhs@uniwa.uwa.oz.au (Rhys Hollow) writes:
  876. > dougm@descartes.cns.caltech.edu (Doug McNaught) writes:
  877. [...]
  878. >   From MY experience, I have found that you have to do both!  Set the
  879. > item rect, AND move the control with MoveControl.  It's all very
  880. > confusing.  Another annoying thing is the way it erases the old position
  881. > of the button at VERY awkward and visually unpleasant times.
  882. >   What I think would be nice is a new Dialog Manager.  Dialog Manager
  883. > coupled with ResEdit is the closest thing we have to Interface Builder,
  884. > however the Operating system end of things falls down if you try to
  885. > anything useful with it.  Ho hum, heavy sigh.
  886. > Rhys Hollow (gurhs@uniwa.uwa.oz.au) "ee'er by gum he's a bad'un!" -DangerMouse.
  887. Hear, hear! This ugly programming necessity had me stumped for WEEKS! That along
  888. with the fact that useritems like a default button HAD TO BE A SEPARATE ITEM FROM
  889. THE ACTUAL BUTTON!
  890.  
  891. Yaargh!
  892.  
  893. Ramon
  894.  
  895.  
  896.  
  897. - -------------------------
  898.  
  899. From: jesjones@milton.u.washington.edu (Jesse Jones)
  900. Subject:  MoveControl within dialog box.
  901. Organization: University of Washington, Seattle
  902. Date: Mon, 3 Feb 1992 22:45:50 GMT
  903.  
  904. Thanks for the tip Doug. I figured out yesterday that both MoveControl and
  905. SetDItem have to be used to move a control.
  906.  
  907.   --Jesse
  908. /
  909.  
  910.  
  911.  
  912. ---------------------------
  913.  
  914. From: Jim.Russell@p395.f70.n109.z1.FidoNet.Org (Jim Russell)
  915. Subject: Unloading Member Function Revisited (long)
  916. Date: 2 Feb 92 17:31:06 GMT
  917.  
  918. Thanks for the excellent summary. I have yet to find an acceptable approach
  919. to unloading Think Class Library segments, but hope that I will find some
  920. hint based on the MPW approaches that were suggested to you. Of course, if
  921. someone has a TCL strategy to call UnloadSeg I would like to see it posted...
  922.  
  923.  
  924.  * Origin: Two wrongs don't make a right - but 3 lefts will. (1:109/70.395)
  925.  
  926.  
  927.  
  928. - -------------------------
  929.  
  930. From: lsr@Apple.COM (Larry Rosenstein)
  931. Subject:  Unloading Member Function Revisited (long)
  932. Date: 4 Feb 92 21:38:51 GMT
  933. Organization: Object Based Systems, Apple Computer, Inc.
  934.  
  935. In article <1992Feb2.101419.15291@foretune.co.jp> trebor@foretune.co.jp (Robert J Woodhead) writes:
  936. >
  937. >Now, in your idle loop, or in any low memory recovery procedure you
  938. >care to define, you can safely set any segment with a count of zero
  939. >to be purgeable.
  940.  
  941. You shouldn't just make the segments purgeable.  You should call UnloadSeg
  942. to ensure that the jump table gets set to the unloaded state.  Otherwise,
  943. you risk having the jump table point to code that isn't there.
  944.  
  945. -- 
  946. Larry Rosenstein, Apple Computer, Inc.
  947.  
  948. lsr@apple.com
  949. (or AppleLink: Rosenstein1)
  950.  
  951.  
  952.  
  953. ---------------------------
  954.  
  955. From: david@oahu.cs.ucla.edu (David Dantowitz)
  956. Subject: Does the SCSI Manager support devices that disconnect?
  957. Date: 3 Feb 92 16:37:45 GMT
  958. Organization: UCLA Computer Science Department
  959.  
  960.  
  961. The ANSI SCSI spec supports device disconnection, where the device
  962. disconnects and then reconnects to the bus when it is ready.  I suppose
  963. this is most useful when there are multiple initiators, but I'm curious
  964. if anyone has used this with Macs.
  965.  
  966. Thanks.
  967.  
  968. -- 
  969. David Dantowitz
  970. david@cs.ucla.edu
  971.  
  972. Singing Barbershop when I'm not computing...
  973.  
  974.  
  975.  
  976. - -------------------------
  977.  
  978. From: lemke@radius.com (Steve Lemke)
  979. Subject:  Does the SCSI Manager support devices that disconnect?
  980. Date: 4 Feb 92 21:23:21 GMT
  981.  
  982. david@oahu.cs.ucla.edu (David Dantowitz) writes:
  983.  
  984.  
  985. >The ANSI SCSI spec supports device disconnection, where the device
  986. >disconnects and then reconnects to the bus when it is ready.  I suppose
  987. >this is most useful when there are multiple initiators, but I'm curious
  988. >if anyone has used this with Macs.
  989.  
  990. The Macintosh SCSI Manager does *NOT* support disconnect and re-select.
  991.  
  992. The only folks who really need this on a Mac are the SCSI Ethernet folks.
  993. Otherwise, without it their software would have to continuously poll the
  994. SCSI box to see if any incoming packets are waiting.  Instead, they patch
  995. the SCSI Manager and implement their own flavor of disconnect and re-select
  996. so that the box can let the Mac know when packets are waiting.
  997.  
  998. This has been done with varying degrees of success by Asante, Compatible
  999. Systems, and Dayna.
  1000.  
  1001. --Steve
  1002.  
  1003. -- 
  1004. - --- Steve Lemke, KC6QDT - Software Engineering, Radius Inc., San Jose -----
  1005. - --- Reply to: lemke@radius.com -- U.C. Santa Barbara ECE Class of '89 -----
  1006. - --- "I'm not a UNIX wizard, but I play the Postmaster at radius.com." -----
  1007.  
  1008.  
  1009.  
  1010. ---------------------------
  1011.  
  1012. From: eckert@anduin.ocf.llnl.gov (Philip Eckert)
  1013. Subject: Microsoft word format question
  1014. Date: 3 Feb 92 21:55:25 GMT
  1015. Organization: Lawrence Livermore Nat'l Lab.
  1016.  
  1017. I was wondering, is their anyway that I can build a document on the Unix system
  1018. and insert some kind of control characters to indicate Center Text, Underline 
  1019. Text, Bold etc.,  so that, when I send the file to my Mac and open it with 
  1020. Microsoft Word the correct things happen?  Or are there possibly some macro 
  1021. files under UNIX for troff that convert to Microsoft Word format?
  1022.  
  1023. Any sense of direction for approaching this would be appreciated.
  1024.  
  1025.  
  1026.  
  1027. - -------------------------
  1028.  
  1029. From: man@cs.brown.edu (Mark H. Nodine)
  1030. Subject:  Microsoft word format question
  1031. Date: 4 Feb 92 15:49:23 GMT
  1032. Organization: Brown Computer Science Dept.
  1033.  
  1034. In article <117179@lll-winken.LLNL.GOV>, eckert@anduin.ocf.llnl.gov (Philip Eckert) writes:
  1035. |> I was wondering, is their anyway that I can build a document on the Unix system
  1036. |> and insert some kind of control characters to indicate Center Text, Underline 
  1037. |> Text, Bold etc.,  so that, when I send the file to my Mac and open it with 
  1038. |> Microsoft Word the correct things happen?  Or are there possibly some macro 
  1039. |> files under UNIX for troff that convert to Microsoft Word format?
  1040.  
  1041. There was an old program called MakeWrite that would accept as its input
  1042. a text file with certain escape sequences (you could decide on your own)
  1043. and create a MacWrite file with the right formatting information.  It did
  1044. not handle centered text, but it had all the text characteristics (italics, bold,
  1045. etc.).  The latest released version was 1.1; I hacked up a 1.2 version that
  1046. included smart quotes, but I never got permission from the author to post it.
  1047.  
  1048. Once you have a MacWrite file, of course, you can use Word's conversion
  1049. utilities to make a Word file.
  1050.  
  1051.     --Mark
  1052.  
  1053.  
  1054.  
  1055. - -------------------------
  1056.  
  1057. From: ABSURD@applelink.apple.com (Tim Dierks, ToyMeister, Cray abuser)
  1058. Subject:  Microsoft word format question
  1059. Date: 5 Feb 92 01:41:54 GMT
  1060. Organization: MacDTS, Apple Computer
  1061.  
  1062. In article <117179@lll-winken.LLNL.GOV>, eckert@anduin.ocf.llnl.gov (Philip Eckert) writes:
  1063. > I was wondering, is their anyway that I can build a document on the Unix system
  1064. > and insert some kind of control characters to indicate Center Text, Underline 
  1065. > Text, Bold etc.,  so that, when I send the file to my Mac and open it with 
  1066. > Microsoft Word the correct things happen?  Or are there possibly some macro 
  1067. > files under UNIX for troff that convert to Microsoft Word format?
  1068. > Any sense of direction for approaching this would be appreciated.
  1069.  
  1070. You might want to look into the Microsoft RTF (Rich Text Format) specification.
  1071. It's an entirely ASCII-based format for encoding this kind of information and
  1072. more.  I believe the spec is available from Microsoft.  MS Word supports it;
  1073. if you attempt to open a text and it guesses that this might be an RTF file
  1074. (probably by looking at the first few lines), it asks you if you want to
  1075. open it as RTF, in which case it's interpreted into a standard formatted
  1076. Word document.
  1077.  
  1078. Tim Dierks
  1079. MacDTS, but I speak for myself
  1080.  
  1081.  
  1082.  
  1083. - -------------------------
  1084.  
  1085. From: GILMART@LSTC2VM.stortek.com (Paul Gilmartin)
  1086. Subject:  Microsoft word format question
  1087. Date: 4 Feb 92 19:37:03 GMT
  1088. Organization: StorageTek SW Engineering
  1089.  
  1090. In article <117179@lll-winken.LLNL.GOV>
  1091. eckert@anduin.ocf.llnl.gov (Philip Eckert) writes:
  1092.  
  1093. >I was wondering, is their anyway that I can build a document on the Unix system
  1094. >and insert some kind of control characters to indicate Center Text, Underline
  1095. >Text, Bold etc.,  so that, when I send the file to my Mac and open it with
  1096. >Microsoft Word the correct things happen?  Or are there possibly some macro
  1097. >files under UNIX for troff that convert to Microsoft Word format?
  1098.  
  1099. Microsoft's preferred representation for interchange of Word documents as text
  1100. is called RTF (Rich Text Format).  There's an address in the Word Ref. Man.
  1101. that you can write to for a copy of the RTF spec.  I don't know of any existing
  1102. troff to RTF filters, but I'd be optimistic -- it sounds like a common need.
  1103.  
  1104.  
  1105.  
  1106. ---------------------------
  1107.  
  1108. From: hennessy@acsu.buffalo.edu (Mathew A Hennessy)
  1109. Subject: Sun .au format -> Mac sound format software?
  1110. Date: 3 Feb 92 23:37:40 GMT
  1111. Organization: UB
  1112.  
  1113.  
  1114.     This question probably pops up all the time, but I still need to
  1115. know... is there a software application for the MAC which will read the .au
  1116. format which the Sun handles?  a Mac version is preferred because my unix
  1117. account is permanently on the quota borderline but if only a unix program is
  1118. available I guess I can make space 8)
  1119.     oh, and which is the best place to find good mac samples?  looking for
  1120. mostly startrek, clockwork orange, 2001, and Ren and Stimpy...
  1121.  
  1122. thanx in advance, 
  1123.  
  1124.  
  1125. -- 
  1126. +-------======++> Sen~or Biggles is hennessy@acsu.buffalo.edu <++=====--------+
  1127. |  "There's only one thing left for me to do, and that's |  Mathew Hennessy   |
  1128. |   to ding-a-ding dang my dang-a-long ling long!"    | M-x insert-disclaimer |
  1129. |            - Ministry              |                       |
  1130.  
  1131.  
  1132.  
  1133. - -------------------------
  1134.  
  1135. From: adiseker@chesapeake.ads.com (Andrew Diseker)
  1136. Subject: .au => SoundEdit
  1137. Date: 4 Feb 92 01:00:32 GMT
  1138. Organization: Advanced Decision Systems division of Booz, Allen & Hamilton
  1139.  
  1140.  
  1141.     To save bandwidth, can someone send me a copy of the routine,
  1142. preferably in C, to convert Sparcstation .au files into the format
  1143. that SoundEdit uses? I'd really appreciate it.
  1144.  
  1145.  
  1146.  
  1147.  
  1148. -- 
  1149. Andrew Diseker                  Advanced Decision Systems
  1150. USMail:     2111 Wilson Blvd Suite 800 Arlington VA 22201-3058
  1151. Internet:   adiseker@ads.com
  1152. Phone:      (703) 875-0308
  1153.  
  1154.  
  1155.  
  1156. ---------------------------
  1157.  
  1158. From: pascal@CAM.ORG (Pascal Gosselin)
  1159. Subject: Alternate LAP support under MacTCP 1.1
  1160. Date: 4 Feb 92 05:48:38 GMT
  1161. Organization: Altitude, St-Lambert QC  CANADA
  1162.  
  1163. I have been told by someone that the Alternate LAP interface for
  1164. MacTCP 1.1 is buggy.  I downloaded the latest sample source from
  1165. ftp.apple.com and the docs DO say that the Alternate LAP is untested
  1166. and unsupported.  Is it that bad?
  1167.  
  1168. Comments, please!
  1169.  
  1170.  
  1171. -- 
  1172. +---------------------------------------------------------------------------+
  1173. | Pascal Gosselin            | Internet: pascal@CAM.ORG  AppleLink: CDA0129 |
  1174. | Omer DeSerres Informatique |   Voice (514) 843-3082    Fax (514) 843-9327 |
  1175. +---------------------------------------------------------------------------+
  1176.  
  1177.  
  1178.  
  1179. - -------------------------
  1180.  
  1181. From: amanda@visix.com (Amanda Walker)
  1182. Subject:  Alternate LAP support under MacTCP 1.1
  1183. Organization: Visix Software, Inc.
  1184. Date: Thu, 6 Feb 92 08:01:34 GMT
  1185.  
  1186. In article <1992Feb4.054838.8555@CAM.ORG>, pascal@CAM.ORG (Pascal Gosselin) 
  1187. writes:
  1188. > I have been told by someone that the Alternate LAP interface for
  1189. > MacTCP 1.1 is buggy.  I downloaded the latest sample source from
  1190. > ftp.apple.com and the docs DO say that the Alternate LAP is untested
  1191. > and unsupported.  Is it that bad?
  1192.  
  1193. It's more underdocumented than buggy, although there do seem to be a few
  1194. bona fide bugs that show up under some conditions.  These don't look like
  1195. Alternate LAP bugs per se, just ones that aren't triggered by the built-in
  1196. LAP modules for AppleTalk and Ethernet.
  1197.  
  1198.  
  1199. Amanda Walker                              amanda@visix.com
  1200. Visix Software Inc.                    ...!uunet!visix!amanda
  1201. -- 
  1202. "TARDIS Express: When it absolutely, positively, has to be there
  1203.  *before* you mailed it..."
  1204.  
  1205.  
  1206.  
  1207.  
  1208. ---------------------------
  1209.  
  1210. From: kacovert@miavx1.acs.muohio.edu
  1211. Subject: Hiding Folders in Think C - again
  1212. Date: 3 Feb 92 18:04:56 GMT
  1213. Organization: Miami University Academic Computer Service
  1214.  
  1215. I asked about this a couple of weeks ago and didn't get any response. 
  1216. Apparently, my post got lost, so I will ask again.
  1217.  
  1218. I have written the following piece of code to toggle a file (in this example
  1219. TEST) between being hidden and being visible.  I would like to do the same for
  1220. directories, but have had no luck.  Could someone please help? 
  1221. An example would be great.
  1222.  
  1223. BTW, this was written using Think C.
  1224.  
  1225. #include <stdio.h>
  1226. #include <Files.h>
  1227. #include <pascal.h>
  1228. main()
  1229. {
  1230.   int OSErr;
  1231.   FInfo fndrInfo;
  1232.     
  1233.   if ((OSErr=GetFInfo("\pHard Disk:TEST",0,&fndrInfo)) != 0)
  1234.   { printf("Error in getting TEST information: %d\n",OSErr); }
  1235.   else
  1236.   { fndrInfo.fdFlags = fndrInfo.fdFlags ^ fInvisible;
  1237.     if ((OSErr=SetFInfo("\pHard Disk:TEST",0,&fndrInfo)) != 0)
  1238.     { printf("Error in changing TEST: %d\n",OSErr); }
  1239.     else
  1240.     { if ((fndrInfo.fdFlags & fInvisible) == fInvisible)
  1241.         printf("Control Panels is now invisible\n");
  1242.       else
  1243.         printf("Control Panels is now visible\n");
  1244.     }
  1245.   }
  1246. }
  1247.  
  1248. Any help would be appreciated.
  1249.  
  1250. -- 
  1251.                                      Kent Covert
  1252.                                      Academic Computer Service
  1253.                                      Miami University, Oxford, OH
  1254.                                      kacovert@miavx1.acs.muohio.edu  (internet)
  1255.                                      kacovert@miavx1                 (bitnet)
  1256.  
  1257.  
  1258.  
  1259. - -------------------------
  1260.  
  1261. From: grobbins@Apple.COM (Grobbins)
  1262. Subject:  Hiding Folders in Think C - again
  1263. Date: 5 Feb 92 10:02:46 GMT
  1264. Organization: Apple DTS
  1265.  
  1266. In article <1992Feb3.130457.8868@miavx1.acs.muohio.edu> kacovert@miavx1.acs.muohio.edu writes:
  1267. >I have written the following piece of code to toggle a file (in this example
  1268. >TEST) between being hidden and being visible.  I would like to do the same for
  1269. >directories, but have had no luck.
  1270.  
  1271. First, the HI lecture:  it's usually not nice to make files or folders
  1272. invisible.  If you need to create a temporary file or folder and you
  1273. want it to remain unseen (and you're running under System 7) use
  1274. FindFolder to locate the Temporary Items folder, and put your file or
  1275. folder in there.
  1276.  
  1277. Invisible files and folders can very easily fill up a hard drive and
  1278. cause other confusing problems in a way which is quite difficult for
  1279. most users to diagnose.  There is almost always a better alternative to
  1280. creating invisible items.  I encourage you to describe why you want to
  1281. create invisible files or folders, and we may be able to suggest an
  1282. alternative which is less likely to have unpleasant side effects for
  1283. users.
  1284.  
  1285. >  if ((OSErr=GetFInfo("\pHard Disk:TEST",0,&fndrInfo)) != 0)
  1286.  
  1287. GetFInfo is only for obtaining Finder information on files, not on
  1288. folders.  Use the low-level call PBGetCatInfo (described in Inside Mac
  1289. IV) instead to obtain information on directories, and PBSetCatInfo to
  1290. change it.
  1291.  
  1292. Also, that line uses a full pathname, which is strongly discouraged
  1293. these days.  Instead, always identify the location of a file or folder
  1294. by the true vRefNum of the drive it resides upon (not the working
  1295. directory refNum), the dirID of its parent folder, and its name.  To
  1296. get file info, use the HFS call HGetFInfo (documented in Inside Mac VI)
  1297. and pass it those three input items instead.  
  1298.  
  1299. Obtaining vRefNums and dirIDs is not hard; for quick&dirty testing, you
  1300. can use a vRefNum of -1 for your boot drive and the dirID 2 for
  1301. anything in the root directory.  In general, you'll get a dirID and
  1302. vRefNum from FindFolder or by calling GetWDInfo on the WDRefNum (the
  1303. "fake vRefNum") returned by SFGetFile/SFPutFile.
  1304.  
  1305. Grobbins            grobbins@apple.com
  1306.  
  1307. Usual disclaimers apply.
  1308.  
  1309.  
  1310.  
  1311. ---------------------------
  1312.  
  1313. From: KURZAEV@JONATHAN.srcc.msu.su
  1314. Subject: Think C 5.0 bug ?
  1315. Date: 3 Feb 92 19:30:54 GMT
  1316. Organization: Research Computing Center, Moscow State University
  1317.  
  1318. Hello, world!
  1319.  
  1320. I'm using Think C 5.0.1. I've a question.
  1321.  
  1322. #define int(a)   ((int)(a))
  1323. #define long(b)  ((long)(b))
  1324.  
  1325. main() {
  1326.   int c;
  1327.   long d;
  1328.  
  1329.   c = int(c);              /* this line is OK */
  1330.   d = long(d);             /* this line is OK */
  1331.   d = long(int(c));        /* but this is NOT */
  1332. }
  1333.  
  1334. If I first preprocess this code, and then check syntax it's OK too.
  1335. Is it a bug, or is it a feature?
  1336.  
  1337. P.S. Think C 4.0.5 doesn't allow "c = int(c);" at all.
  1338.  
  1339. Best regards,
  1340. Paul Kurzaev
  1341. Russia, Moscow University Computer Center
  1342. AppleLink: MOSCOW.UNIV
  1343. eMail:     KURZAEV@JONATHAN.srcc.msu.su
  1344.  
  1345.  
  1346.  
  1347. - -------------------------
  1348.  
  1349. From: Carl.Constantine@BCSystems.GOV.BC.CA
  1350. Subject:  Think C 5.0 bug ?
  1351. Date: 6 Feb 92 07:41:28 -0800
  1352. Organization: BC Systems Corporation
  1353.  
  1354. In article <832951013B@srcc.msu.su>, KURZAEV@JONATHAN.srcc.msu.su writes:
  1355. > Hello, world!
  1356. > I'm using Think C 5.0.1. I've a question.
  1357. > #define int(a)   ((int)(a))
  1358. > #define long(b)  ((long)(b))
  1359. > main() {
  1360. >   int c;
  1361. >   long d;
  1362. >   c = int(c);              /* this line is OK */
  1363. >   d = long(d);             /* this line is OK */
  1364. >   d = long(int(c));        /* but this is NOT */
  1365. > }
  1366. > If I first preprocess this code, and then check syntax it's OK too.
  1367. > Is it a bug, or is it a feature?
  1368. > P.S. Think C 4.0.5 doesn't allow "c = int(c);" at all.
  1369.  
  1370. You shouldn't use the int type on the Mac (or so I've been told by Thom Hogan
  1371. and Kurt Mathies(sp??)).  Instead use short to typecast your variables
  1372.  
  1373. main()
  1374. {
  1375.    short c;
  1376.    long  d;
  1377.  
  1378.    c = short(c);
  1379.    d = long(d);
  1380.    d = long(short(c));
  1381. }
  1382.  
  1383. I'm not guaranteeing that this will work, but it's a start based on what I've
  1384. been told about C programming on the Mac.  Also, try to get the THINK C 5.0.2
  1385. updater (with TCL 1.1.2) from Sumex [36.44.0.6].
  1386.  
  1387. -- 
  1388. Carl.Constantine@BCSystems.gov.bc.ca
  1389. British Columbia, Canada
  1390.  
  1391.  
  1392.  
  1393.  
  1394. ---------------------------
  1395.  
  1396. From: canfield_rw@lrc.edu
  1397. Subject: system calls
  1398. Date: 4 Feb 92 07:08:46 GMT
  1399. Organization: Lenoir-Rhyne College, Hickory, NC
  1400.  
  1401. i have been looking through some of the gamemaster files in order to look
  1402. at how the mac windows are created and manipulated during some simple game
  1403. play (that is with out worying of the computer play)  within the
  1404. programs. while compiling the battleships rulebook - i got down to the battle-
  1405. shipsdraw.unit and had trouble with the HGetState and HLock.
  1406.   writen as
  1407.     temp := HGetState(handle(windowPeek^.refcon));
  1408.   and
  1409.     HLock(Handle(windowPeek^.refcon));
  1410. in the Draw procedure.
  1411. errors reported as --  "HGetState" is not declared.
  1412.  
  1413. they are both system calls declared as -- 
  1414.     function HGetState(theHandle :Handle) :signedByte;
  1415.     procedure HLock(theHandle :Handle);
  1416.  
  1417. i am using lightspeed pascal and if anyone has any clue as to why this 
  1418. is occuring please email them to me.
  1419.  
  1420. thanks.-   
  1421.  
  1422. ===============================================================================
  1423.  
  1424.                Raymond Canfield
  1425.  
  1426.                ____     ____         Ride the horn.
  1427.               /    \        
  1428.               |----|    ---- 
  1429.               \____/    ____            KO 175
  1430.  
  1431.             Canfield_rw@lrc.edu
  1432.  
  1433. ===============================================================================
  1434.  
  1435.  
  1436.  
  1437. - -------------------------
  1438.  
  1439. From: gurhs@uniwa.uwa.oz.au (Rhys Hollow)
  1440. Subject:  system calls
  1441. Date: 5 Feb 92 07:37:44 GMT
  1442. Organization: University of Western Australia
  1443.  
  1444. canfield_rw@lrc.edu writes:
  1445. : i have been looking through some of the gamemaster files in order to look
  1446. : at how the mac windows are created and manipulated during some simple game
  1447. : play (that is with out worying of the computer play)  within the
  1448. : programs. while compiling the battleships rulebook - i got down to the battle-
  1449. : shipsdraw.unit and had trouble with the HGetState and HLock.
  1450. :   writen as
  1451. :     temp := HGetState(handle(windowPeek^.refcon));
  1452. :   and
  1453. :     HLock(Handle(windowPeek^.refcon));
  1454. : in the Draw procedure.
  1455. : errors reported as --  "HGetState" is not declared.
  1456.  
  1457.   First a question, is the above sample a direct copy, or is it typed in
  1458. from memory.  Because windowPeek is a TYPE not a pointer, and
  1459. referencing it as a pointer is not going to work :)  I would look at the
  1460. rulebook sources, but I don't have them on me at the moment.
  1461.   Which version of Think Pascal are you using?  If it is an old one,
  1462. then it may not have the HGetState calls.
  1463.   Also, are you sure that it's the 'HGetState' not being declared? From
  1464. what I know of Think Pascal error messages, usually it just points to
  1465. the line and says 'One of these things confuses me'.  It doesn't tell
  1466. you which one.  And a lot of the time the error messages are more
  1467. confusing than the error.  The error reporting DEFINITELY needs an
  1468. overhaul.
  1469.   Hope this helps, hope it doesn't just confuse.
  1470.  
  1471.    Rhys.
  1472. - -----------------------------------------------------------------------------
  1473. Rhys Hollow (gurhs@uniwa.uwa.oz.au) "ee'er by gum he's a bad'un!" -DangerMouse.
  1474.  
  1475.  
  1476.  
  1477. ---------------------------
  1478.  
  1479. From: rrichter@link.ph.gmr.com (Roy Richter)
  1480. Subject: ThinkC TCL Printer problem - too many strips
  1481. Date: 4 Feb 92 14:05:32 GMT
  1482. Organization: GM Research, Warren, Mi
  1483.  
  1484. This is int the TCL 1.1.2 libraries.
  1485. In CPanorama::Paginate, where the number of printer strips to
  1486. break an image into is calculated, one finds:
  1487.  
  1488. hStrips = PixWidth / pageWidth + 1;
  1489. vStrips = PixHeight / pageHeight + 1;
  1490.  
  1491. If your pane is exactly the size of the printed page, this returns
  1492. 4 strips (2 horizontal and 2 vertical).  A typical off-by-one error.
  1493.  
  1494. Shouldn't it be:
  1495.  
  1496. hStrips = PixWidth / (pageWidth + 1) + 1;
  1497. vStrips = PixHeight / (pageHeight + 1) + 1;
  1498.  
  1499.  
  1500. Is it me or is it TCL?
  1501.  
  1502. --
  1503. Roy Richter                  Internet: rrichter@ph.gmr.com
  1504. Physics Dept, GM Research    UUCP:     rphroy!rrichter
  1505.  
  1506. The yellow jester does not play but gently pulls the strings,
  1507. and smiles as the puppets dance in the court of the crimson king.
  1508.  
  1509.  
  1510.  
  1511. - -------------------------
  1512.  
  1513. Subject:  ThinkC TCL Printer problem - too many strips
  1514. From: guelzow@brandonu.ca
  1515. Date: 5 Feb 92 12:45:43 CST
  1516. Organization: Brandon University, Brandon, Manitoba, Canada
  1517.  
  1518. In article <76199@rphroy.ph.gmr.com>,
  1519. rrichter@link.ph.gmr.com (Roy Richter) writes:
  1520. > This is int the TCL 1.1.2 libraries.
  1521. > In CPanorama::Paginate, where the number of printer strips to
  1522. > break an image into is calculated, one finds:
  1523. > hStrips = PixWidth / pageWidth + 1;
  1524. > vStrips = PixHeight / pageHeight + 1;
  1525. > If your pane is exactly the size of the printed page, this returns
  1526. > 4 strips (2 horizontal and 2 vertical).  A typical off-by-one error.
  1527. > Shouldn't it be:
  1528. > hStrips = PixWidth / (pageWidth + 1) + 1;
  1529. > vStrips = PixHeight / (pageHeight + 1) + 1;
  1530. > Is it me or is it TCL?
  1531. It's both of you: As you pointed out, the TCL may print unneeded pages.
  1532. Your calculation may yield hStrips and vStrips that are too small if 
  1533. PixW/H is much larger than pageW/H. Just imaged the extreme case:
  1534. pageWidth = 1, PixWidth = 5. hStrips should be 5 but your calculation
  1535. yields 3.
  1536. Correct would be:
  1537.  hStrips = (PixWidth-1) / pageWidth  + 1;
  1538.  vStrips = (PixHeight-1) / pageHeight + 1;
  1539. (I think.)
  1540. - -----------------------------------------------------------------------------
  1541. Andreas Guelzow  Dept. of Mathematics & Comp. Sc. Brandon University MB Canada
  1542. Guelzow@BrandonU.Ca
  1543.  
  1544.  
  1545.  
  1546. ---------------------------
  1547.  
  1548. End of C.S.M.P. Digest
  1549. **********************
  1550.